With advances in computer engineering, large amounts of information are stored in mass storage devices. Some of these storage devices use technology that integrates automatic memory operations, which are administered within the storage device. That is, the automatic memory operations are not administered by the processor of the host that uses the storage device. Examples of such automatic memory operations include garbage collection operations that reclaim and recycle dynamic memory that is not being used, wear leveling operations that increase the likelihood that cells within a flash memory system are worn fairly evenly, defragmentation operations that reduce the amount of fragmentation in file systems, and power fail protection operations that protect data from abnormal program termination and other data loss problems.
It is very difficult for a host to predict the time required to complete a storage operation such as write, read or delete. One reason is because the memory operations described above are automatically administered within the storage device and thus not by the host processor. The automatic memory operations cause the times to complete storage operations to vary considerably. For example, the longest time imaginable to write a 10 Mbyte file to a storage device might be 20 times longer than the shortest time.
In order to operate more efficiently, a host processor may respond as follows to the uncertainty in predicting the time required to complete storage operations:
The host processor may wait idly until the storage operation terminates. That is, the host processor and the storage device would work sequentially. Such procedure wastes processing time, because the host processor cannot perform other tasks while the storage operation executes.
Alternatively, after sending a storage command, the host processor can switch to another task and return to the original task after the storage operation terminates. However, as the storage operation may terminate before the host processor finishes switching tasks, the original task must wait longer than necessary to resume.
Another option is a process known as “polling,” in which the host processor frequently checks if the storage operation in the storage device has completed. Such continuous interrogation consumes significant processing time.
Yet another option is, after sending a storage command to the storage device, the host processor can perform context switching to execute another task, execute the other task, and then perform context switching again to return to the original task. However, context switching is time-consuming, and, if the storage operation has not yet completed by the time that the processor returns to the original task, the host processor must perform context switching again and consume more time.
These options for optimizing processor efficiency do not account for the effect of automatic memory operations on the duration of storage operations. Information regarding the scheduling of automatic storage operations is not readily available to a processor in a host, because these operations are administered within the storage device. Because the effect of the automatic actions on storage operations is so significant, the optimization of processor efficiency is limited when one of the options described above is implemented. Thus, it would be desirable to account somehow for the effect of automatic memory operations on the duration of storage operations.